<?

//Initiate Authenticate
SecurityRedirect ();

//initiate Vars
define("PRIMARY_KEY","skada");
$KEY[]         = array("PRIMARY_KEY"=>PRIMARY_KEY);
$FileName      = "ais_report_accinc_cons.php";
$FileTemplate  = "ais_report_accinc_list.html";
$TableName     = "ais_memorial";
$SubHeaderTitle= "Report - Income Statement Consolidation";
$PageSize      = 10 ;
$HTMLGridList  = "RepJT";
//************ FORM ACTION **************

//Initiate Database Table For Search;
$FNama = GetParam("coaSearch","");
$FCode = GetParam("coaCodeSearch","");

//******* DATABASE FORM QUERY ***********
$SQL = "SELECT * FROM `$TableName`";
$SQLCount = "SELECT count(*) FROM `$TableName` ";

if ($FNama)
        if (strlen($WHERE)) $WHERE .= " AND "." namacc like '".$FNama."%'";
        else $WHERE .= " namacc like '".$FNama."%'";
if ($FCode)
        if (strlen($WHERE)) $WHERE .= " AND "." skada like '".$FCode."%'";
        else $WHERE .= " skada like '".$FCode."%'";

        if (strlen($WHERE))        $WHERE = " WHERE ".$WHERE;
        else $WHERE = " WHERE 1";

$SQL = $SQL.$WHERE;
$SQLCount = $SQLCount.$WHERE;
$SQL = $SQL." ORDER BY skada";
//print $SQL;
//Select Department
$SQLDept = "SELECT * FROM tbldept";

//******* SHOW FORM CONTENT *********
$PageNum = 1;
$RecCnt = $DBConnection->dbc->get_var($SQLCount) ;

if (GetParam("PageNum","")) $PageNum  = GetParam("PageNum","");

$TBS = new clsTinyButStrong ;
$TBS->LoadTemplate($MOD_TEMPLATE_DIR."/".$FileTemplate);
$TBS->MergeBlock("monthformblk",GetArrayMonth());
$TBS->MergeBlock("yearformblk",GetArrayYear());
$TBS->MergeBlock("monthlastblk",GetArrayMonth());
$TBS->MergeBlock("yearlastblk",GetArrayYear());

$SQLOffice = "SELECT * FROM tblkantor";
$TBS->MergeBlock("officeformblk",$DBMysql,$SQLOffice);

$TBS->Show();


?>
